package service;

import dao.UserMapper;
import entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class UserServiceImpl implements UserService{
    @Resource
    private UserMapper userMapper;


    public User getUser(String userName,String userPass) {
        return userMapper.getUser(userName, userPass) ;
    }

    @Override
    public void userAdd(User user) {
        userMapper.userAdd(user);
    }

    @Override
    public void UpUserPass(User user) {
        userMapper.UpUserPass(user);
    }

    @Override
    public boolean isUserExist(String userName,String userPass) {
        if(userMapper.getUser(userName,userPass)==null){
           return false;
        }
        return true;
    }


}
